package com.youxin.cpcenter.api;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.youxin.busfoundation.bean.ResponseObject;
import com.youxin.busfoundation.bean.login.RequestLoginBean;
import com.youxin.busfoundation.bean.login.RequestLoginVerifyCode;
import com.youxin.busfoundation.bean.login.RequestRefreshToken;

/**
 * 登录接口调用
 * @author yingde.cao
 *
 */
@FeignClient(value = "authserver")
public interface AuthApi {
	
	/**
	 * 登录
	 * @param bean
	 * @return
	 */
	@RequestMapping(value = "/auth/login", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseObject login(@RequestBody RequestLoginBean bean);
	/**
	 * 刷新token
	 * @param bean
	 * @return
	 */
	@RequestMapping(value = "/auth/token/refresh", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseObject refreshToken(@RequestBody RequestRefreshToken bean);
	
	/**
	 * 获取验证码
	 * @param bean
	 * @return
	 */
	@RequestMapping(value = "/auth/login/verifycode", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseObject verifyCode(@RequestBody RequestLoginVerifyCode bean);
	
	@RequestMapping(value = "/auth/logout", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseObject logout(@RequestBody RequestRefreshToken bean);
	
	@RequestMapping(value = "/auth/info", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseObject loginfo();
	
}
